package com.zqx.tokenauth.util;




import com.zqx.tokenauth.vo.ResultVO;

import java.util.List;

/**
 * @author zqx
 * @date 2018.07.19
 */
public class ResultVOUtil {

    public static ResultVO success(Object object)
    {
        ResultVO resultVO = new ResultVO();
        resultVO.setData(object);
        resultVO.setCode(0L);
        resultVO.setMsg("成功");
        return resultVO;
    }

    public static ResultVO success()
    {
        return success(null);
    }

    public static ResultVO error(Long code,String msg)
    {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }

    public static ResultVO error(Long code)
    {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(code);
        return resultVO;
    }

    public static ResultVO ok(Object object)
    {
        ResultVO resultVO = new ResultVO();
        resultVO.setData(object);
        resultVO.setCode(0L);
        resultVO.setMsg("成功");
        return resultVO;
    }

    public static ResultVO ok()
    {
        return success(null);
    }
}
